//
//  LoginViewController.m
//  DirectProDuct
//
//  Created by hl on 16/1/20.
//  Copyright (c) 2016年 ping. All rights reserved.
//

#import "LoginViewController.h"
#import "LoginMainView.h"
#import "XiTongMainViewController.h"
@interface LoginViewController (){
    LoginMainView *mainView;
}

@end

@implementation LoginViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self drawView];
    // Do any additional setup after loading the view.
}
-(void)drawView{
    UITapGestureRecognizer *hidden = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hiddenKeyBoard)];
    
    
    mainView = [[LoginMainView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
    [mainView addGestureRecognizer:hidden];
    [mainView.loginBtn addTarget:self action:@selector(toLogin) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:mainView];
}
-(void)hiddenKeyBoard{
    [mainView.nameField resignFirstResponder];
    [mainView.passWordField resignFirstResponder];
}
-(void)toLogin{
    [mainView.nameField resignFirstResponder];
    [mainView.passWordField resignFirstResponder];
    
    XiTongMainViewController *home = [[XiTongMainViewController alloc] init];
    [self.navigationController pushViewController:home animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
